package string;

public class SubstringDemo {
    public static void main(String[] args) {
        /*
         * 截取子字符串
         */
        //            0123456789012345
        String str = "Thinking in Java";
        String s = str.substring(2,5); //ink
        System.out.println(s);
        String s2 = str.substring(4,4+4); //king
        System.out.println(s2);
        String s3 = str.substring(12, 12+4);//Java
        System.out.println(s3);

    }
}
